#include <stdio.h>
#include <string.h>
#include <stdlib.h>

//1.w打开基础上直接fread没事？
//2.fclose后，没重新fopen但使用fread的现象？
//3.不fclose以w打开的fp，直接再对其以r打开会怎么样？

int main()
{
  FILE* fp = fopen("bite","w");

  char msg[] = "linux so easy!";
  fwrite(msg,sizeof(char),strlen(msg),fp);
  fclose(fp);

  char* ret = (char*)calloc(strlen(msg)+1, sizeof(char));
  fp = fopen("bite","r");
  fread(ret,sizeof(char),strlen(msg),fp);
  printf("%s\n",ret);
  
  free(ret);
  fclose(fp);
  return 0;
}
